package org.lili.lambdaexp;

import org.lili.semanticmodel.Graph;

import static org.lili.lambdaexp.GraphBuilder.Graph;

/**
 * @author lili
 * @description ${DESCRIPTION}
 * @create 2018-04-22 下午3:56
 * @since
 **/
public class LambdaDslDemo {

    public static void main(String[] args) {
        Graph g1 = Graph(g -> {
            //给图形设置边
            g.edge(e -> {
                //给边设置点
                e.from("a");
                e.to("b");
                e.weight(12.4);
            });

            g.edge(e -> {
                e.from("c");
                e.to("d");
                e.weight(13.4);
            });
        });
        Graph.printGraph(g1);
    }
}
